package site.wenneng.dev.common.enumeration;

public enum RemoteSiteEnum {
    DEV("https://dev.hundsun.com"),
    FINE_BI("https://finebi.hundsun.com");

    private String origin;

    RemoteSiteEnum(String origin) {
        this.origin = origin;
    }

    public static RemoteSiteEnum fitUrl(String url) {
        for (RemoteSiteEnum value : RemoteSiteEnum.values()) {
            if (url.startsWith(value.getOrigin())) {
                return value;
            }
        }
        return null;
    }

    public String getOrigin() {
        return origin;
    }
}
